package com.chukun.flink.stream.kafka;

import com.chukun.flink.stream.bean.KafkaMess;
import org.apache.flink.api.common.eventtime.Watermark;
import org.apache.flink.api.common.eventtime.WatermarkGenerator;
import org.apache.flink.api.common.eventtime.WatermarkOutput;

/**
 * @author chukun
 * @version 1.0.0
 * @description kafka watermarker生成器
 * @createTime 2022年06月04日 11:47:00
 */
public class KafkaWatermarkGenerator implements WatermarkGenerator<KafkaMess> {
    @Override
    public void onEvent(KafkaMess kafkaMess, long timestamp, WatermarkOutput watermarkOutput) {

    }

    @Override
    public void onPeriodicEmit(WatermarkOutput watermarkOutput) {
         watermarkOutput.emitWatermark(new Watermark(System.currentTimeMillis()));
    }
}
